<?php
include('../common/config.php');
$conn = new connectDb();

$lngE = $_POST['lngE'];
$lngW = $_POST['lngW'];
$latN = $_POST['latN'];
$latS = $_POST['latS'];
$sqlProvince = "select `name` from food_province where lng > $lngW and lng < $lngE and lat > $latS and lat < $latN order by id asc";
$queryProvince = mysql_query($sqlProvince) or die(mysql_error());
while($rowProvince = mysql_fetch_array($queryProvince))
{
	$name = $rowProvince['name'];
	$dataProvince[$name] = $name;
}
/*
foreach($dataProvince as $key => $value)
{
$sql = "select `news_title`,`news_link`,`news_time` from food_caiji_zccw where area = '$value' order by id asc"; 
	$query = mysql_query($sql) or die(mysql_error());
	while($row = mysql_fetch_array($query,MYSQL_ASSOC)){
	//	$province = array('province'=>$value);
	//	array_push($row,$province);
	//	$row['province'] = $value;
		$dataNews[] = $row;
	}
	$data[$value] = $dataNews; 
	
}
//print_r($data);*/
echo json_encode($dataProvince);







?>
